

package com.maoshi.shop.discount.comment.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.maoshi.shop.bean.app.dto.DiscountDto;
import com.maoshi.shop.bean.app.dto.ProductDto;
import com.maoshi.shop.common.util.PageParam;
import com.maoshi.shop.discount.comment.model.Discount;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface DiscountMapper extends BaseMapper<Discount> {

    Discount getDiscountAndItemAndProdById(@Param("discountId") Long discountId);

    List<Discount> getDiscountsAndItemsByShopId(@Param("shopId") Long shopId);

    int deleteDiscounts(@Param("id") Long id, @Param("shopId") Long shopId);

    List<DiscountDto> listByProdId(@Param("prodId") Long prodId, @Param("shopId") Long shopId);

    IPage<ProductDto> discountProdList(PageParam<ProductDto> page, @Param("discountId") Long discountId);

    IPage<Discount> getPlatformDiscountPage(@Param("page") PageParam<Discount> page, @Param("discount") Discount discount);

    int updateStatusByDiscountId(@Param("discountId") Long discountId, @Param("status") Integer status);


    IPage<DiscountDto> getDiscountList(PageParam<Discount> page);

    DiscountDto getDiscountByDiscountId(@Param("discountId") Long discountId);
}
